package com.lc202310;

/**
 * Description:
 *
 * @Create 2023/10/12 22:26
 * @Version 1.0
 */
public class Solution83 {
    public ListNode deleteDuplicates(ListNode head) {
        if (head == null) {
            return head;
        }
        ListNode cur = head;
        // head不能进行赋值操作
        while (cur.next != null) {
            // 指针跳过
            if (cur.val == cur.next.val) {
                cur.next = cur.next.next;
                continue;
            }
            cur = cur.next;
        }
        return head;
    }
}
